package com.example.program;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.widget.ListView;

import com.example.program.Utils.PassUtils;
import com.example.program.adapter.PassAdapter;
import com.example.program.bean.PassBean;

import java.util.ArrayList;

/**
 * Created by LPL on 2016/12/18.
 */

public class PassActivity extends AppCompatActivity {
    private ListView lv;

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.pass_menu, menu);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pass);
        InitVar();
    }

    private void InitVar() {
        ArrayList<PassBean> a = new PassUtils(this).getAllPass();
        lv = (ListView) findViewById(R.id.lv_ls);
        PassAdapter passAdapter = new PassAdapter(this, a);
        lv.setAdapter(passAdapter);
    }

}
